import os

wksp_root = os.environ["WKSP_ROOT"]

env = Environment(
    ENV=os.environ,
    TOOLS=["questa"],
    SIM_DIR=os.path.join(wksp_root, "sim/"),
    WORK="work",
    TOP_MOD="barrel_shifter_tb",
    VSIM_ARGS=["-voptargs=+acc", "-c", '-do "run -all; quit"'],
)

SConscript(
    [
        os.path.join(wksp_root, "src/SConscript"),
        os.path.join(wksp_root, "tb/SConscript"),
    ],
    exports=["env"],
)

vsim = env.Vsim("${SIM_DIR}vsim.log", ["compile_src", "compile_tb"])
AlwaysBuild(vsim)
